/* Consola - Frames/MainFrame.cc
 * Copyright (c) 2009 The Consola Authors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * 
 */
#include "Consola/StdAfx.h"
#include "Consola/resource.h"
#include "Consola/Frames/MainFrame.h"
#include "Consola/Dialogs/About.h"
#include "Consola/Dialogs/GlobalOptions.h"

BOOL CMainFrame::PreTranslateMessage(MSG *pMsg)
{
    return CMDIFrameWindowImpl<CMainFrame>::PreTranslateMessage(pMsg);
}

BOOL CMainFrame::DoUpdate()
{
    UIUpdateToolBar();

    return FALSE;
}

LRESULT CMainFrame::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
    CreateMDIClient();

    CMessageLoop *lpLoop = g_AppModule.GetMessageLoop();
    lpLoop->AddMessageFilter(this);
    lpLoop->AddUpdateUI(this);

    return 0;
}

LRESULT CMainFrame::OnFileExit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
    PostMessage(WM_CLOSE);

    return 0;
}

LRESULT CMainFrame::OnViewHorizontal(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
    MDITile(MDITILE_HORIZONTAL);

    return 0;
}

LRESULT CMainFrame::OnWindowVertical(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
    MDITile(MDITILE_VERTICAL);

    return 0;
}

LRESULT CMainFrame::OnWindowCascade(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
    MDICascade(0);

    return 0;
}

LRESULT CMainFrame::OnGlobalOptions(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
    CDialogGlobalOptions curDialog;

    curDialog.DoModal();

    return 0;
}

LRESULT CMainFrame::OnAbout(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
    CDialogAbout curDialog;

    curDialog.DoModal();

    return 0;
}

LRESULT CMainFrame::OnMDISetMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
    return 0;
}

/* EOF */

